public class demo8 {
    public static void main(String[] args) {
        Thread t1 = new Thread() {
            @Override
            public void run() {
                super.run();
                for(int i = 0; i <= 100; i ++ ){
                    System.out.println(i + "听歌");
                }
            }
        };
        Thread t2 = new Thread(){
            @Override
            public void run() {
                super.run();
                for(int i = 0; i <= 100; i ++ ){
                    if(i == 10){
                        Thread.yield();
                    }
                    System.out.println(i + "看书");
                }
            }
        };
        t1.start();
        t2.start();
    }
}
